package com.taotao.st3.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.taotao.st3.base.enumhub.enumat.EnumField;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 描述信息
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2020/9/7 17:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "个人信息")
public class PersonDTO {
    @NotBlank(message = "姓名不能为空")
    @Schema(description = "姓名")
    private String name;
    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "生日")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthday;

    @Schema(description = "爱好")
    @EnumField(HobyEnum.class)
    private String hoby;


    @Schema(description = "爱好2")
    private HobyEnum hoby2;
}
